var gulp = require('gulp'),
    cssmin = require('gulp-minify-css'),
    del = require('del'),
    uglify = require('gulp-uglify'),
    minifyHtml = require('gulp-minify-html')

gulp.task('cssMin', function () {
    gulp.src('./**/*.css')
        .pipe(cssmin())
        .pipe(gulp.dest('./'));
});

gulp.task('jsMin', function () {
    gulp.src('./**/*.js')
        .pipe(uglify())
        .pipe(gulp.dest('./'));
})

gulp.task('htmlMin', function () {
    gulp.src('./**/*.html')
        .pipe(minifyHtml())
        .pipe(gulp.dest('./'));
})

gulp.task('del', function (cb) {
    del([
        'school.js'
    ], cb)
});

gulp.task('default', function () {
    gulp.run('cssMin', 'jsMin','htmlMin');//立刻执行'minjs','mincss'这两个任务;gulp.run(tasks)表示运行对应的任务
});